/**
 * @file t_cmd_bus_config.h
 * @brief cmd bus config file.
 * @author eson (<eson_tang@163.com>)
 * @date 2025-6-7
 * @version 1.0.0
 * @copyright Copyright (c) 2025-2035  eson. All rights reserved.
 * @note  GPL v2.0 license.
 */

#ifndef T_CMD_BUS_CONFIG_H
#define T_CMD_BUS_CONFIG_H
#include <stdint.h>
#include <stddef.h>
#include <stdbool.h>
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
#ifdef __cplusplus
extern "C"
{
#endif

#define T_CMD_BUS_VERSION "1.0.0"

#define RTOS_ENABLE 1// 0: disable rtos, 1: enable rtos.

#define ENABLE_DEBUG_LOG 0

#if RTOS_ENABLE
    #include "FreeRTOS.h"
    #include "task.h"
    #include "semphr.h"
    #define CD_MALLOC(x) {pvPortMalloc(x), memset(x, 0, sizeof(x))}
    #define CD_FREE(x) vPortFree(x)
#else
    #define CD_MALLOC(x) malloc(x)
    #define CD_FREE(x) free(x)
#endif

#ifdef __cplusplus
}
#endif

#endif
/* T_CMD_BUS_CONFIG_H*/